#ifndef _ENTITYMANAGER_H_
#define _ENTITYMANAGER_H_

#include "script.h"

class CEntity;

class CEntityManager
{
private:
	typedef struct  
	{
		CEntity *entity;
		SquirrelFunction<void> sqFunc_update;
		SquirrelFunction<void> sqFunc_paint;

	}TEntityRec;


	TEntityRec *m_entityList;
	int m_entityCount;
	int m_entitySize;

	static CEntityManager *_this;

	

	CEntityManager();
protected:
public:
	static CEntityManager *getInstance();
	static void killInstance();
	virtual ~CEntityManager();

	virtual void update();
	virtual void paint();



	//scripted methods

	SQInteger sq_addEntity(CEntity *entity, HSQUIRRELVM vm);
};

#endif //_ENTITYMANAGER_H_